from datetime import datetime
from flask_app.extensions import db
from .user_md import UserMD

class UserRoleMD(db.Model):
    __tablename__ = "user_role_t"
    # 人员角色唯一标识
    id = db.Column(db.String(80), primary_key=True)

    # 角色id
    role_id= db.Column(db.String(80),db.ForeignKey("role_t.id"))

    user_id = db.Column(db.String(80),db.ForeignKey("user_account_t.id"))

    user = db.relationship("UserAccountMD", backref='user_account_role',uselist=True)

    role = db.relationship("RoleMD", backref='role',uselist=True)